package com.javaone;

import java.util.Scanner;

public class Demo9 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输4位会员卡号：");
        int i = scanner.nextInt();
        System.out.println("会员卡号是");
        int num1=i%10;
        int num2=i/10%10;
        int num3=i/100%10;
        int num4=i/1000;
        int sum=num1+num2+num3+num4;
        System.out.println("总和是："+sum);
        System.out.println(sum>20?"中奖了":"没有中奖");
    }
}
